function [combos_all_unique] = combinations_10(m_regr,J)

combos_all = uint8(combinations_2(m_regr,J));      % these are combos that are unique up to reshuffling in the first J arguments, but NOT in the second J arguments

duplicate = sparse(zeros(size(combos_all,1),1));

temp_mat = uint8(combos_all);
temp_ind = setdiff(perms(1:J-1),1:J-1,'rows');
index_x = 2:J;
index_x_reord = index_x(temp_ind);
index_z = J+2:2*J;
index_z_reord = index_z(temp_ind);

for i=1:size(combos_all,1)
    %tic
    if duplicate(i)==0
        
        temp_mat(i,:) = NaN;
        
        temp_vec = combos_all(i,:);
        
        %         parfor kk=1:size(temp_ind,1)
            
           qq = [temp_vec(ones(size(temp_ind,1),1)*1)' temp_vec(index_x_reord) ...
                  temp_vec(ones(size(temp_ind,1),1)*(J+1))' temp_vec(index_z_reord)];
        
        if isempty(qq)==0      
              
            tt = find(ismember(temp_mat,qq,'rows'));  
                          
%         end

        if max(tt(:))>0
            
            tempp = (tt>0);
                        
            duplicate(tt(tempp)) = 1;
            
            temp_mat(tt(tempp),:) = NaN;
            
        end
        
        end
        
    end
    %i/size(combos_all,1)
    %toc
end

combos_all_unique = combos_all(duplicate==0,:);



end